package com.kabigon.tiny.convert;

import com.kabigon.tiny.dto.MemberDto;
import com.kabigon.tiny.po.Member;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * 会员对象映射 (依赖注入)
 * @author xu.biao
 * @version v1.0
 * @Package com.kabigon.tiny.convert
 * @data 2022/5/29 22:14
 */
@Mapper(componentModel = "spring")
public interface MemberSpringConvert {

    @Mapping(source = "phone", target = "phoneNumber")
    @Mapping(source = "birthday", target = "birthday", dateFormat = "yyyy-MM-dd")
    MemberDto toDto(Member member);
}
